
<script>
	import {
		index
	} from "pages/index/api.js"

	export default {
	
		
		onLaunch: function () {
			let token = uni.getStorageSync("token")
			this.$store.commit("changeToken", token)
			
			
		  const updateManager = uni.getUpdateManager()
		  updateManager.onCheckForUpdate(function (res) {
		    // 请求完新版本信息的回调
		    console.log(res.hasUpdate)
		  })
		  // 下载新版本
		  updateManager.onUpdateReady(function () {
		    uni.showModal({
		      title: '更新提示',
		      content: '新版本已经准备好，是否重启应用？',
		      success(res) {
		        if (res.confirm) {
		          // 重启应用
		          updateManager.applyUpdate()
		        }
		      },
		    })
		  })
		  // 新版本下载失败
		  updateManager.onUpdateFailed(function (res) {
		    // 新的版本下载失败
		    uni.showModal({
		      title: '已经有新版本了哟~',
		      content: '新版本已经上线啦~，请您删除当前小程序，重新搜索打开哟~',
		    })
		  })
		},

		onShow: function() {},
		onHide: function() {}

	}
</script>
<style lang="scss">
	@import "@/uni_modules/uview-ui/index.scss";
	/*每个页面公共css */
	// @import "./tm-vuetify/mian.min.css";
	// @import "./tm-vuetify/scss/theme.css";

	* {
		margin: 0;
		padding: 0;
	}
	
	.uni-tabbar{box-shadow: 0px -4px 10px rgba(0, 0, 0, 0.06);}
	
	.flex1{ flex:1}
	.img{ vertical-align: top;}

	page {
		width: 750rpx;
		// height: 100%;
		background: #F8F8F8;
	}
	.flex-row-flex-start {
				display: flex;
				flex-direction: row;
			align-items: center;
				justify-content: flex-start;
		}
	
		.flex-row-flex-start1 {
				display: flex;
				flex-direction: row;
			// align-items: center;
				justify-content: flex-start;
		}
	
		.flex-row-center {
				display: flex;
			flex-direction: row;
				align-items: center;
				justify-content: center;
		}
	
		.flex-column-center {
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
		}
	
		.flex-column-center1 {
				display: flex;
			flex-direction: column;
				// align-items: center;
				justify-content: center;
		}
	
		.flex-column-flex-start {
			display: flex;
				flex-direction: column;
				// align-items: center; 
			justify-content: flex-start;
		}
	
		.flex-column-flex-start1 {
				display: flex;
				flex-direction: column;
			align-items: center;
			justify-content: flex-start;
		}
	
		.flex-row-space-between {
				display: flex;
				flex-direction: row;
			align-items: center;
			justify-content: space-between;
		}
	
		.flex-row-space-between1 {
				display: flex;
				flex-direction: row;
			// align-items: center;
				justify-content: space-between;
		}
	
		.flex-row-space-around {
				display: flex;
				flex-direction: row;
			align-items: center;
				justify-content: space-around;
		}
	
		.flex-column-space-between {
				display: flex;
				flex-direction: column;
				/* align-items: center; */
				justify-content: space-between;
		}
	
		.flex-row-flex-end {
				display: flex;
			flex-direction: row;
				align-items: center;
				justify-content: flex-end;
		}
	
		.flex-column-flex-end {
			display: flex;
				flex-direction: column;
				vertical-align: center;
			justify-content: flex-end;
		}
	
	
		.display-flex {
				display: flex;
		}
	
		.flex-direction-row {
			flex-direction: row;
		}
	
		.flex-direction-column {
			flex-direction: column;
		}
	
		.justify-content-flex-start {
				justify-content: flex-start;
		}
	
		.justify-content-center {
				justify-content: center;
		}
	
		.align-items-flex-start {
				align-items: flex-start;
		}
	
		.align-items-center {
			align-items: center;
		}
	
		.justify-content-space-between {
				justify-content: space-between;
		}
	
		.justify-content-flex-end {
				justify-content: flex-end;
		}
	
		.vertical-align-center {
				vertical-align: center;
		}
	
		.BGImage {
				position: fixed;
			width: 100%;
				height: 100%;
				top: 0;
			left: 0;
				z-index: -1;
		}
	
		.flex1 {
				flex: 1
		}
	
		.flex-wrap {
			flex-wrap: wrap;
		}
	
		/* 其他 */
		.relative {
			position: relative;
		}
	
		.absolute {
			position: absolute;
		}
	
		.fixed {
			position: fixed;
		}
	
		.fixed-top {
			position: fixed;
			top: 0;
			left: 0;
			right: 0;
			z-index: 99;
		}
	
		.fixed-bottom {
			position: fixed;
			bottom: 0;
			left: 0;
			right: 0;
			z-index: 99;
		}
</style>
